import re

# 读取文件
with open('backend/app.py', 'r', encoding='utf-8') as f:
    content = f.read()

# 替换所有 timeout=120 为 timeout=300
content = re.sub(r'timeout=120', 'timeout=300', content)

# 替换 base_timeout=120 为 base_timeout=300
content = re.sub(r'base_timeout=120', 'base_timeout=300', content)

# 写回文件
with open('backend/app.py', 'w', encoding='utf-8') as f:
    f.write(content)

print("已将所有超时时间从120秒更新为300秒")